//
//  ViewController3.m
//  ipad_split
//
//  Created by user on 12-8-20.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "ViewController3.h"
#import <QuartzCore/QuartzCore.h>

@interface ViewController3 ()

@end

@implementation ViewController3
@synthesize flowcover;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    //[UICoverFlowLayer alloc] 
    flowcover.delegate = self;
}

- (void)viewDidUnload
{
    [self setFlowcover:nil];
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
	return YES;
}

#pragma mark - (FlowCoverViewDelegate)

- (int)flowCoverNumberImages:(FlowCoverView *)view
{
    return 12;
}
- (UIImage *)flowCover:(FlowCoverView *)view cover:(int)cover
{
    switch (cover%6) {
        case 0:
            return [UIImage imageNamed:@"a.png"];
            break;
        case 1:
            return [UIImage imageNamed:@"b.png"];
            break;
        case 2:
            return [UIImage imageNamed:@"c.png"];
            break;
        case 3:
            return [UIImage imageNamed:@"x.png"];
        case 4:
            return [UIImage imageNamed:@"y.png"];
            break;
        case 5:
            return [UIImage imageNamed:@"z.png"];
            
        default:
            break;
    }
    return nil;
}
- (void)flowCover:(FlowCoverView *)view didSelect:(int)cover
{
    NSLog(@"selected is:%d", cover);
}

- (void)dealloc {
    [flowcover release];
    [super dealloc];
}
@end







